﻿<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>登录 - 主城</title>
	<!-- Loading Bootstrap -->
	<link href="~/sRaw/ui/css/bootstrap.min.css" rel="stylesheet">
	<!-- Loading Flat UI -->
	<link href="~/sRaw/ui/css/flat-ui.min.css" rel="stylesheet">

	<link rel="shortcut icon" href="~/sRaw/ui/img/favicon.ico">
	<style type="text/css">
		.headline {
			padding: 5px 0 0;
			text-align: center;
			color: darkmagenta;
		}

		.about {
			position: relative;
			margin-left: auto;
			margin-right: auto;
			color: white;
			text-align: center;
		}

		.input {
			text-align: center;
			width: 300px;
			margin-left: auto;
			margin-right: auto;
			margin-bottom: 20px;
		}

			.input:focus {
				color: #228586;
				border-color: #08C534 !important;
			}

		body {
			background-color: #1abc9c;
			width: 400px;
			margin-left: auto;
			margin-right: auto;
		}

		.flogin {
			position: relative;
			background-color: #edeff1;
			border-radius: 6px;
			box-sizing: border-box;
			width: 400px;
			margin-left: auto;
			margin-right: auto;
			margin-bottom: 20px;
			margin-top: 60px;
		}

		.fbutton {
			margin-left: 35px;
			margin-right: auto;
			margin-bottom: 10px;
			width: 300px;
		}

		.fbuttonr {
			margin-left: 35px;
			margin-right: auto;
			margin-bottom: 20px;
			width: 300px;
			background-color: #0ba8d2 !important;
			border-color: #0ba8d2 !important;
		}

			.fbuttonr:hover {
				background-color: #09b8e7 !important;
				border-color: #09b8e7 !important;
			}

			.fbuttonr:active {
				background-color: #286090 !important;
				border-color: #204d74 !important;
			}

		.calert {
			margin-top: 20px;
		}
	</style>
</head>
<body>
	<div class="flogin container" id="view">
		<h3 class="headline"> 登录</h3>
		<input type="text" placeholder="输入账号" class="input form-control flat" id="inputusername" />
		<input type="password" placeholder="输入密码" class="input form-control flat" id="inputpassword" />
		<button class="fbutton btn btn-embossed btn-primary" id="login">登录 - 进入主城</button><br />
		<button class="fbuttonr btn btn-primary" id="register">点击这里注册一个账号</button><br />
	</div>
	<h5 class="about">Powered By SpaceTimeX</h5>
	<h6 class="about">Using Custom Application</h6>
	<script src="~/sRaw/ui/js/jquery.min.js"></script>
	<script src="~/sRaw/ui/js/video.js"></script>
	<script src="~/sRaw/ui/js/flat-ui.min.js"></script>
	<script src="~/sRaw/ui/js/prettify.js"></script>
	<script src="~/sRaw/ui/js/application.js"></script>
	<script src="~/sRaw/ui/js/sign.js"></script>
	<script>

		$("#login").click(function () {
			var _username = $("#inputusername").val();
			var _password = $("#inputpassword").val();
			var arg = {};
			arg["username"] = _username;
			arg["password"] = _password;
			$.post("/Main/checkLogin", arg, function (data) {
				if (data.state == "Error") {
					var added = "<div class=\"calert alert alert-danger alert-dismissible fade in\" role=\"alert\">\n" +
					"<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n" +
					"<Font size=2><strong>" + data.error + "</strong></FONT> \n" +
					"</div>";
					$("#view").prepend(added);

				} else if (data.state == "Success") {
					window.location = "/Main/Home";
				}
			}, "json");

		});

		$("#register").click(function () {
			window.location = "/Main/Register";
		});


	</script>
</body>
</html>
